
#include "Alignment.h"

Alignment::Alignment()
{
    initialObjectRegistered.reset(new PointCloud<PointXYZ>);
    objectRegistered.reset(new PointCloud<PointXYZ>);
    world_keypoints.reset(new PointCloud<PointXYZI>);
    correspond.reset(new Correspondences);
    initial_transformation_matrix=Eigen::Matrix4f::Identity();
    final_transformation_matrix=Eigen::Matrix4f::Identity();
    transformation_matrix=Eigen::Matrix4f::Identity();
    initialScore=FLT_MAX;
    finalScore=FLT_MAX;
}

//GETTERS
PointCloud<PointXYZ>::Ptr Alignment::getInitialObjectRegistered()
{
    return initialObjectRegistered;
}
PointCloud<PointXYZ>::Ptr Alignment::getObjectRegistered()
{
    return objectRegistered;
}
PointCloud<PointXYZI>::Ptr Alignment::getWorld_keypoints()
{
    return world_keypoints;
}
CorrespondencesPtr Alignment::getCorrespond()
{
    return correspond;
}
Eigen::Matrix4f Alignment::getInitial_transformation_matrix()
{
    return initial_transformation_matrix;
}
Eigen::Matrix4f Alignment::getFinal_transformation_matrix()
{
    return final_transformation_matrix;
}
Eigen::Matrix4f Alignment::getTransformation_matrix()
{
    return transformation_matrix;
}
float Alignment::getInitialScore()
{
    return initialScore;
}
float Alignment::getFinalScore()
{
    return finalScore;
}

//SETTERS
void Alignment::setInitialObjectRegistered(PointCloud<PointXYZ>::Ptr initialObjectRegisteredGiven)
{
    initialObjectRegistered=initialObjectRegisteredGiven;
}
void Alignment::setObjectRegistered(PointCloud<PointXYZ>::Ptr objectRegisteredGiven)
{
    objectRegistered=objectRegisteredGiven;
}
void Alignment::setWorld_keypoints(PointCloud<PointXYZI>::Ptr world_keypointsGiven)
{
    world_keypoints=world_keypointsGiven;
}
void Alignment::setCorrespond(CorrespondencesPtr correspondGiven)
{
    correspond=correspondGiven;
}
void Alignment::setInitial_transformation_matrix(Eigen::Matrix4f initial_transformation_matrixGiven)
{
    initial_transformation_matrix=initial_transformation_matrixGiven;
}
void Alignment::setFinal_transformation_matrix(Eigen::Matrix4f final_transformation_matrixGiven)
{
    final_transformation_matrix=final_transformation_matrixGiven;
}
void Alignment::setTransformation_matrix(Eigen::Matrix4f transformation_matrixGiven)
{
    transformation_matrix=transformation_matrixGiven;
}
void Alignment::setInitialScore(float &initialScoreGiven)
{
    initialScore=initialScoreGiven;
}
void Alignment::setFinalScore(float &finalScoreGiven)
{
    finalScore=finalScoreGiven;
}
